<template>
    <div style="margin-top: 10px;">
        <!-- 分页组件 -->
        <el-pagination
            style="text-align:right;"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="pageNum1+1"
            :page-sizes="selectPageSize1"
            :page-size="pageSize1"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total1"> 
        </el-pagination>
    </div>
</template>
<script>
export default {
    props:['pageNum','pageSize','selectPageSize','total'],
    data(){
        return{
            pageNum1:'',
            pageSize1:'',
            selectPageSize1:'',
            total1:'',
        }
    },
    created(){
        this.pageNum1 = this.pageNum;
        this.pageSize1 = this.pageSize;
        this.selectPageSize1 = this.selectPageSize;
        this.total1 = this.total;
    },
    updated(){
        this.pageNum1 = this.pageNum;
        this.pageSize1 = this.pageSize;
        this.selectPageSize1 = this.selectPageSize;
        this.total1 = this.total;
    },
    methods:{
        handleCurrentChange(val) {
            this.pageNum1 = val - 1;
            this.$emit('pageChange',{pageNum:this.pageNum1,pageSize:this.pageSize1});
        },
        handleSizeChange(val) {
            this.pageSize1 = val;
            this.pageNum1 = 0;
            this.$emit('pageChange',{pageNum:this.pageNum1,pageSize:this.pageSize1});
        },
    }
}
</script>
